<template>
  <div ref="myDiv">Hello World</div>
</template>

<script setup>
import { ref, onMounted } from 'vue'

const myDiv = ref(null)

onMounted(() => {
  console.log(myDiv.value) // 输出 DOM 元素
})
</script>
